$galleries = App\Gallery::inRandomOrder()->get(); //Or DB::table('gallery')->inRandomOrder()->get();